package cn.easy.kitchen.repository;

import cn.easy.kitchen.domain.Customer;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface CustomerDao extends PagingAndSortingRepository<Customer, String>, JpaSpecificationExecutor<Customer> {

    Customer findByOldNo(String code);

    @Query("SELECT count(id) FROM  Customer where  name not like '%公司%' ")
    int countSchool();

    List<Customer> findByShortName(String shortName);
}
